package com.tongji.showroom.command
{
	
	import com.tongji.showroom.events.GetSystemSceneEvent;
	import com.tongji.showroom.model.SystemSceneModel;
	import com.tongji.showroom.model.UserModel;
	import com.tongji.showroom.service.GetSystemSceneService;
	
	import org.robotlegs.mvcs.Command;
	
	/**
	 * 
	 * @author jiarong
	 * 2011-10-31
	 *
	 */
	
	public class GetSystemSceneCommand extends Command
	{
		[Inject]
		public var service:GetSystemSceneService;
		
		[Inject]
		public var event:GetSystemSceneEvent;
		
		[Inject]
		public var model:SystemSceneModel;
		
		public function GetSystemSceneCommand()
		{
			super();
		}
		
		override public function execute():void
		{
			switch(event.type)
			{
				case GetSystemSceneEvent.GET_ALL_SCENE:
					service.getAllScene(event.userId, event.scjId, event.sfgId, event.currentPage, event.pageSize);
					break;
				case GetSystemSceneEvent.UPDATE_ALL_SCENE:
					model.updateScene(event.scene);
					break;
				default:
					break;
			}
		}
	}
}